Optimal. Leaf size=82 \[ \frac {3 a \tan (c+d x)}{2 d}-\frac {a \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac {3 a x}{2}-\frac {b \cos ^3(c+d x)}{3 d}+\frac {2 b \cos (c+d x)}{d}+\frac {b \sec (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {2838, 2591, 288, 321, 203, 2590, 270} \[ \frac {3 a \tan (c+d x)}{2 d}-\frac {a \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac {3 a x}{2}-\frac {b \cos ^3(c+d x)}{3 d}+\frac {2 b \cos (c+d x)}{d}+\frac {b \sec (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 270
Rule 288
Rule 321
Rule 2590
Rule 2591
Rule 2838
Rubi steps
\begin {align*} \int \sin ^2(c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx &=a \int \sin ^2(c+d x) \tan ^2(c+d x) \, dx+b \int \sin ^3(c+d x) \tan ^2(c+d x) \, dx\\ &=\frac {a \operatorname {Subst}\left (\int \frac {x^4}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}-\frac {b \operatorname {Subst}\left (\int \frac {\left (1-x^2\right )^2}{x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {a \sin ^2(c+d x) \tan (c+d x)}{2 d}+\frac {(3 a) \operatorname {Subst}\left (\int \frac {x^2}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}-\frac {b \operatorname {Subst}\left (\int \left (-2+\frac {1}{x^2}+x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {2 b \cos (c+d x)}{d}-\frac {b \cos ^3(c+d x)}{3 d}+\frac {b \sec (c+d x)}{d}+\frac {3 a \tan (c+d x)}{2 d}-\frac {a \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac {(3 a) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=-\frac {3 a x}{2}+\frac {2 b \cos (c+d x)}{d}-\frac {b \cos ^3(c+d x)}{3 d}+\frac {b \sec (c+d x)}{d}+\frac {3 a \tan (c+d x)}{2 d}-\frac {a \sin ^2(c+d x) \tan (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.42, size = 82, normalized size = 1.00 \[ -\frac {3 a (c+d x)}{2 d}+\frac {a \sin (2 (c+d x))}{4 d}+\frac {a \tan (c+d x)}{d}+\frac {7 b \cos (c+d x)}{4 d}-\frac {b \cos (3 (c+d x))}{12 d}+\frac {b \sec (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.71, size = 72, normalized size = 0.88 \[ -\frac {2 \, b \cos \left (d x + c\right )^{4} + 9 \, a d x \cos \left (d x + c\right ) - 12 \, b \cos \left (d x + c\right )^{2} - 3 \, {\left (a \cos \left (d x + c\right )^{2} + 2 \, a\right )} \sin \left (d x + c\right ) - 6 \, b}{6 \, d \cos \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.21, size = 119, normalized size = 1.45 \[ -\frac {9 \, {\left (d x + c\right )} a + \frac {12 \, {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} + \frac {2 \, {\left (3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 24 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 10 \, b\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.41, size = 104, normalized size = 1.27 \[ \frac {a \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+b \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.44, size = 75, normalized size = 0.91 \[ -\frac {3 \, {\left (3 \, d x + 3 \, c - \frac {\tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1} - 2 \, \tan \left (d x + c\right )\right )} a + 2 \, {\left (\cos \left (d x + c\right )^{3} - \frac {3}{\cos \left (d x + c\right )} - 6 \, \cos \left (d x + c\right )\right )} b}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 18.22, size = 112, normalized size = 1.37 \[ -\frac {3\,a\,x}{2}-\frac {3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+5\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+5\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {32\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+3\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {16\,b}{3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________